<template>
  <div class="reportFormPage horizontal-border">
    <div class="report-dom horizontal">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">沥青混合料马歇尔试验检测记录(表干法)</div>
        <div class="codeText">
          <tr>
            JGLQ11002a
          </tr>
          <tr>
            JGLQ11003
          </tr>
        </div>
      </div>
      <div class="threeTopBox">
        <div class="left-border">
          <div class="box-title">检测单位名称：</div>
          <div class>{{ form.jiancdwmc }}</div>
        </div>
        <div class="right-border">
          <span>记录编号：</span>
          <span v-if="isPdf" class="placeholder">{{ form.jilbh }}</span>
          <el-input class="code-input" v-else type="text" v-model="form.jilbh" @focus="handleFocus('jilbh')" />
        </div>
      </div>
      <div class="table-border">
        <!-- .........................1111111111111111111111111111111......................................................... -->
        <table height="150px" class="top-table">
          <tbody>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程名称</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcmc }}</span>
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程部位/用途</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcbwyt }}</span>
              </td>
            </tr>
            <tr>
              <td height="30" align="center">样品信息</td>
              <td class="specimen-border" colspan="3">
                <span>样品名称：</span>
                <span :class="{ placeholder: !form.yangpmc }">{{ form.yangpmc }}</span>
                <span>；样品编号：</span>
                <span :class="{ 'placeholder-long': !form.yangpbh }">{{ form.yangpbh }}</span>
                <span>；样品数量：</span>
                <span :class="{ placeholder: !form.yangpsl }">{{ form.yangpsl }}</span>
                <span>；样品状态：</span>
                <span :class="{ placeholder: !form.yangpzt }">{{ form.yangpzt }}</span>
                <span>；来样时间：</span>
                <span :class="{ placeholder: !form.yangpsj }">{{ form.yangpsj }}</span>
              </td>
            </tr>

            <tr>
              <td height="25" align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验检测日期</span>
              </td>
               <!-- <td width="35%" class="text-center">{{ form.shiyjcrq }}</td> -->                                            
 <td width="35%" class="text-center">
      <el-input v-model="form.shiyjcrq" />
</td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验条件</span>
              </td>
              <td v-if="isPdf" width="35%">
                温度：
                <span style="display: inline-block; width: 10%">{{ form.shiytjwd }}</span>
                ℃；湿度：
                <span style="display: inline-block; width: 10%">{{ form.shiytjsd }}</span
                >%RH
              </td>
              <td v-else width="35%">
                温度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjwd" style="width: 15%" />℃；湿度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjsd" style="width: 15%" />%RH
              </td>
            </tr>

            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">检测依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.jiancyj }}</span>
                <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark" @dblclick.native="showBsJiancyjView" readonly />
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">判定依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.pandyj }}</span>
                <el-input v-else type="textarea" v-model="form.pandyj" :rows="2" @dblclick.native="showBsJudgeBaseView" @focus="handleFocus('pandyj')" class="mark" />
              </td>
            </tr>
            <tr class="bottom-border">
              <td height="30" align="center">
                <div>主要仪器设备</div>
                <div>名称及编号</div>
              </td>
              <td colspan="3">
                <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
                <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh" class="height100 width100 mark" @dblclick.native="showBsInstrumentView" readonly></el-input>
              </td>
            </tr>
          </tbody>
        </table>
        <!-- .................................22222222222222222222222222222222............................................... -->
        <table height="100px" class="middle-table">
          <tbody>
            <tr height="20">
              <td colspan="2">沥青用量(%)</td>
              <td colspan="2"><el-input type="number" v-model="form.liqyl" @change="countJxl" @keydown.native="handleKeyDown($event, 0, 0)" :ref="'0_0'" /></td>
              <td colspan="2">击实温度(℃)</td>
              <td colspan="2"><el-input type="text" v-model="form.jiswd" @keydown.native="handleKeyDown($event, 0, 1)" :ref="'0_1'" /></td>
              <td colspan="2">混合料类型</td>
              <td colspan="2"><el-input type="text" v-model="form.hunhllx" @change="handleInput" @keydown.native="handleKeyDown($event, 0, 2)" :ref="'0_2'" /></td>
              <td colspan="2">环境温度(℃)</td>
              <td colspan="2"><el-input type="text" v-model="form.huanjwd" @keydown.native="handleKeyDown($event, 0, 3)" :ref="'0_3'" /></td>
              <td colspan="2">标准试件尺寸(mm)</td>
              <td colspan="2"><el-input type="text" v-model="form.biaozsjcc" @change="handleInput" @keydown.native="handleKeyDown($event, 0, 4)" :ref="'0_4'" /></td>
            </tr>
            <tr height="20">
              <td colspan="2">击实次数</td>
              <td colspan="2"><el-input type="text" v-model="form.jiscs" @change="handleInput" @keydown.native="handleKeyDown($event, 1, 0)" :ref="'1_0'" /></td>
              <td colspan="4">理论最大相对密度</td>
              <td colspan="2"><el-input type="number" v-model="form.lilzdxdmd" @change="countKxl" @keydown.native="handleKeyDown($event, 1, 1)" :ref="'1_1'" /></td>
              <td colspan="4">矿料合成毛体积相对密度</td>
              <td colspan="2"><el-input type="number" v-model="form.kuanglhcmtjxdmd" disabled /></td>
              <td colspan="2">沥青相对密度</td>
              <td colspan="2"><el-input type="number" v-model="form.liqdxdmd" @change="countYxlqtjbfb" @keydown.native="handleKeyDown($event, 1, 2)" :ref="'1_2'" /></td>
            </tr>
            <tr height="20">
              <td colspan="2">0.075mm的通过率(%)</td>
              <td colspan="2"><el-input type="number" v-model="form.tonggl" @change="countFjb" @keydown.native="handleKeyDown($event, 2, 0)" :ref="'2_0'" /></td>
              <td colspan="4">被集料吸收的沥青结合料比例Pba(%)</td>
              <td colspan="2"><el-input type="number" v-model="form.liqjhlbl" @keydown.native="handleKeyDown($event, 2, 1)" :ref="'2_1'" /></td>
              <td colspan="4">有效沥青用量Pbe(%)</td>
              <td colspan="2"><el-input type="number" v-model="form.youxlqyl" @change="countYxlqtjbfb" @keydown.native="handleKeyDown($event, 2, 2)" :ref="'2_2'" /></td>
              <td colspan="2">粉胶比FB</td>
              <td colspan="2"><el-input type="number" v-model="form.fenjb" disabled /></td>
            </tr>
            <tr height="20">
              <td colspan="4">纤维名称/种类</td>
              <td colspan="4"><el-input v-model="form.xianwmc" @keydown.native="handleKeyDown($event, 3, 0)" :ref="'3_0'" /></td>
              <td colspan="4">纤维用量(%)</td>
              <td colspan="2"><el-input type="number" v-model="form.xianwyl" @keydown.native="handleKeyDown($event, 3, 1)" :ref="'3_1'" /></td>
              <td colspan="4">纤维25℃时的相对密度</td>
              <td colspan="2"><el-input type="number" v-model="form.xianwxdmd" @keydown.native="handleKeyDown($event, 3, 2)" :ref="'3_2'" /></td>
            </tr>
            <tr height="20">
              <td colspan="4">矿料名称</td>
              <td colspan="2"><el-input type="text" v-model="form.detail1List[0].kuanglmc" @keydown.native="handleKeyDown($event, 4, 0)" :ref="'4_0'" /></td>
              <td colspan="2"><el-input type="text" v-model="form.detail1List[1].kuanglmc" @keydown.native="handleKeyDown($event, 4, 1)" :ref="'4_1'" /></td>
              <td colspan="2"><el-input type="text" v-model="form.detail1List[2].kuanglmc" @keydown.native="handleKeyDown($event, 4, 2)" :ref="'4_2'" /></td>
              <td colspan="2"><el-input type="text" v-model="form.detail1List[3].kuanglmc" @keydown.native="handleKeyDown($event, 4, 3)" :ref="'4_3'" /></td>
              <td colspan="2"><el-input type="text" v-model="form.detail1List[4].kuanglmc" @keydown.native="handleKeyDown($event, 4, 4)" :ref="'4_4'" /></td>
              <td colspan="2"><el-input type="text" v-model="form.detail1List[5].kuanglmc" @keydown.native="handleKeyDown($event, 4, 5)" :ref="'4_5'" /></td>
              <td colspan="2"><el-input type="text" v-model="form.detail1List[6].kuanglmc" @keydown.native="handleKeyDown($event, 4, 6)" :ref="'4_6'" /></td>
              <td colspan="2"><el-input type="text" v-model="form.detail1List[7].kuanglmc" @keydown.native="handleKeyDown($event, 4, 7)" :ref="'4_7'" /></td>
            </tr>
            <tr height="20">
              <td colspan="4">毛体积相对密度</td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[0].maotjxdmd" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 5, 0)" :ref="'5_0'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[1].maotjxdmd" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 5, 1)" :ref="'5_1'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[2].maotjxdmd" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 5, 2)" :ref="'5_2'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[3].maotjxdmd" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 5, 3)" :ref="'5_3'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[4].maotjxdmd" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 5, 4)" :ref="'5_4'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[5].maotjxdmd" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 5, 5)" :ref="'5_5'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[6].maotjxdmd" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 5, 6)" :ref="'5_6'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[7].maotjxdmd" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 5, 7)" :ref="'5_7'" /></td>
            </tr>
            <tr height="20">
              <td colspan="4">表观相对密度</td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[0].biaogxdmd" @keydown.native="handleKeyDown($event, 6, 0)" :ref="'6_0'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[1].biaogxdmd" @keydown.native="handleKeyDown($event, 6, 1)" :ref="'6_1'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[2].biaogxdmd" @keydown.native="handleKeyDown($event, 6, 2)" :ref="'6_2'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[3].biaogxdmd" @keydown.native="handleKeyDown($event, 6, 3)" :ref="'6_3'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[4].biaogxdmd" @keydown.native="handleKeyDown($event, 6, 4)" :ref="'6_4'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[5].biaogxdmd" @keydown.native="handleKeyDown($event, 6, 5)" :ref="'6_5'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[6].biaogxdmd" @keydown.native="handleKeyDown($event, 6, 6)" :ref="'6_6'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[7].biaogxdmd" @keydown.native="handleKeyDown($event, 6, 7)" :ref="'6_7'" /></td>
            </tr>
            <tr height="20">
              <td colspan="4">矿料比例</td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[0].kuanglbl" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 7, 0)" :ref="'7_0'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[1].kuanglbl" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 7, 1)" :ref="'7_1'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[2].kuanglbl" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 7, 2)" :ref="'7_2'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[3].kuanglbl" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 7, 3)" :ref="'7_3'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[4].kuanglbl" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 7, 4)" :ref="'7_4'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[5].kuanglbl" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 7, 5)" :ref="'7_5'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[6].kuanglbl" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 7, 6)" :ref="'7_6'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.detail1List[7].kuanglbl" @change="countKuanglhcmtjxdmd" @keydown.native="handleKeyDown($event, 7, 7)" :ref="'7_7'" /></td>
            </tr>
            <tr height="20">
              <td rowspan="3">序号</td>
              <td colspan="6">试件尺寸(mm)</td>
              <td rowspan="3">干燥试件空中质量(g)</td>
              <td rowspan="3">试件水中质量(g)</td>
              <td rowspan="3">试件表干质量(g)</td>
              <td rowspan="3">吸水率(%)</td>
              <td rowspan="3">毛体积相对密度</td>
              <td rowspan="3">空隙率VV(%)</td>
              <td rowspan="3">有效沥青体积百分率Vbe(%)</td>
              <td rowspan="3">间隙率VMA(%)</td>
              <td rowspan="3">沥青饱和度VMA(%)</td>
              <!-- <td rowspan="3">粗集料骨架间隙率VCAmix(%)</td> -->
              <td rowspan="3">稳定度(kN)</td>
              <td rowspan="3">流值(mm)</td>
              <td rowspan="3">马歇尔模数(kN/mm)</td>
            </tr>
            <tr height="20">
              <td rowspan="2">直径</td>
              <td colspan="5">高度</td>
            </tr>
            <tr height="20">
              <td>1</td>
              <td>2</td>
              <td>3</td>
              <td>4</td>
              <td>平均值</td>
            </tr>
            <tr height="20">
              <td width="5%"><el-input type="text" v-model="form.detail2List[0].xvh" @keydown.native="handleKeyDown($event, 8, 0)" :ref="'8_0'" /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].zhij" @keydown.native="handleKeyDown($event, 8, 1)" :ref="'8_1'" /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].gaod1" @change="countGdPjz(0)" @keydown.native="handleKeyDown($event, 8, 2)" :ref="'8_2'" /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].gaod2" @change="countGdPjz(0)" @keydown.native="handleKeyDown($event, 8, 3)" :ref="'8_3'" /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].gaod3" @change="countGdPjz(0)" @keydown.native="handleKeyDown($event, 8, 4)" :ref="'8_4'" /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].gaod4" @change="countGdPjz(0)" @keydown.native="handleKeyDown($event, 8, 5)" :ref="'8_5'" /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].gaodpjz" disabled /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].ganzsjkzzl" @change="countXsl(0)" @keydown.native="handleKeyDown($event, 8, 6)" :ref="'8_6'" /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].shijszzl" @change="countXsl(0)" @keydown.native="handleKeyDown($event, 8, 7)" :ref="'8_7'" /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].shijbgzl" @change="countXsl(0)" @keydown.native="handleKeyDown($event, 8, 8)" :ref="'8_8'" /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].xisl" disabled /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].maotjxdmd" disabled /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].kongxl" disabled /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].youxlqtjbfl" disabled /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].jianxl" disabled /></td>
              <td width="5%"><el-input type="number" v-model="form.detail2List[0].lqbhd" disabled /></td>
              <!-- <td width="5%"><el-input type="number" v-model="form.detail2List[0].cujlgjjxl" /></td> -->
              <td width="6%"><el-input type="number" v-model="form.detail2List[0].wendd" @change="countMaxems(0)" @keydown.native="handleKeyDown($event, 8, 9)" :ref="'8_9'" /></td>
              <td width="6%"><el-input type="number" v-model="form.detail2List[0].liuz" @change="countMaxems(0)" @keydown.native="handleKeyDown($event, 8, 10)" :ref="'8_10'" /></td>
              <td width="8%"><el-input type="number" v-model="form.detail2List[0].maxems" disabled /></td>
            </tr>
            <tr height="20">
              <td><el-input type="text" v-model="form.detail2List[1].xvh" @keydown.native="handleKeyDown($event, 9, 0)" :ref="'9_0'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].zhij" @keydown.native="handleKeyDown($event, 9, 1)" :ref="'9_1'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].gaod1" @change="countGdPjz(1)" @keydown.native="handleKeyDown($event, 9, 2)" :ref="'9_2'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].gaod2" @change="countGdPjz(1)" @keydown.native="handleKeyDown($event, 9, 3)" :ref="'9_3'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].gaod3" @change="countGdPjz(1)" @keydown.native="handleKeyDown($event, 9, 4)" :ref="'9_4'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].gaod4" @change="countGdPjz(1)" @keydown.native="handleKeyDown($event, 9, 5)" :ref="'9_5'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].gaodpjz" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[1].ganzsjkzzl" @change="countXsl(1)" @keydown.native="handleKeyDown($event, 9, 6)" :ref="'9_6'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].shijszzl" @change="countXsl(1)" @keydown.native="handleKeyDown($event, 9, 7)" :ref="'9_7'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].shijbgzl" @change="countXsl(1)" @keydown.native="handleKeyDown($event, 9, 8)" :ref="'9_8'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].xisl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[1].maotjxdmd" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[1].kongxl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[1].youxlqtjbfl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[1].jianxl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[1].lqbhd" disabled /></td>
              <!-- <td><el-input type="number" v-model="form.detail2List[1].cujlgjjxl" /></td> -->
              <td><el-input type="number" v-model="form.detail2List[1].wendd" @change="countMaxems(1)" @keydown.native="handleKeyDown($event, 9, 9)" :ref="'9_9'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].liuz" @change="countMaxems(1)" @keydown.native="handleKeyDown($event, 9, 10)" :ref="'9_10'" /></td>
              <td><el-input type="number" v-model="form.detail2List[1].maxems" disabled /></td>
            </tr>
            <tr height="20">
              <td><el-input type="text" v-model="form.detail2List[2].xvh" @keydown.native="handleKeyDown($event, 10, 0)" :ref="'10_0'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].zhij" @keydown.native="handleKeyDown($event, 10, 1)" :ref="'10_1'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].gaod1" @change="countGdPjz(2)" @keydown.native="handleKeyDown($event, 10, 2)" :ref="'10_2'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].gaod2" @change="countGdPjz(2)" @keydown.native="handleKeyDown($event, 10, 3)" :ref="'10_3'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].gaod3" @change="countGdPjz(2)" @keydown.native="handleKeyDown($event, 10, 4)" :ref="'10_4'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].gaod4" @change="countGdPjz(2)" @keydown.native="handleKeyDown($event, 10, 5)" :ref="'10_5'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].gaodpjz" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[2].ganzsjkzzl" @change="countXsl(2)" @keydown.native="handleKeyDown($event, 10, 6)" :ref="'10_6'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].shijszzl" @change="countXsl(2)" @keydown.native="handleKeyDown($event, 10, 7)" :ref="'10_7'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].shijbgzl" @change="countXsl(2)" @keydown.native="handleKeyDown($event, 10, 8)" :ref="'10_8'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].xisl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[2].maotjxdmd" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[2].kongxl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[2].youxlqtjbfl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[2].jianxl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[2].lqbhd" disabled /></td>
              <!-- <td><el-input type="number" v-model="form.detail2List[2].cujlgjjxl" /></td> -->
              <td><el-input type="number" v-model="form.detail2List[2].wendd" @change="countMaxems(2)" @keydown.native="handleKeyDown($event, 10, 9)" :ref="'10_9'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].liuz" @change="countMaxems(2)" @keydown.native="handleKeyDown($event, 10, 10)" :ref="'10_10'" /></td>
              <td><el-input type="number" v-model="form.detail2List[2].maxems" disabled /></td>
            </tr>
            <tr height="20">
              <td><el-input type="text" v-model="form.detail2List[3].xvh" @keydown.native="handleKeyDown($event, 11, 0)" :ref="'11_0'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].zhij" @keydown.native="handleKeyDown($event, 11, 1)" :ref="'11_1'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].gaod1" @change="countGdPjz(3)" @keydown.native="handleKeyDown($event, 11, 2)" :ref="'11_2'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].gaod2" @change="countGdPjz(3)" @keydown.native="handleKeyDown($event, 11, 3)" :ref="'11_3'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].gaod3" @change="countGdPjz(3)" @keydown.native="handleKeyDown($event, 11, 4)" :ref="'11_4'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].gaod4" @change="countGdPjz(3)" @keydown.native="handleKeyDown($event, 11, 5)" :ref="'11_5'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].gaodpjz" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[3].ganzsjkzzl" @change="countXsl(3)" @keydown.native="handleKeyDown($event, 11, 6)" :ref="'11_6'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].shijszzl" @change="countXsl(3)" @keydown.native="handleKeyDown($event, 11, 7)" :ref="'11_7'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].shijbgzl" @change="countXsl(3)" @keydown.native="handleKeyDown($event, 11, 8)" :ref="'11_8'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].xisl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[3].maotjxdmd" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[3].kongxl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[3].youxlqtjbfl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[3].jianxl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[3].lqbhd" disabled /></td>
              <!-- <td><el-input type="number" v-model="form.detail2List[3].cujlgjjxl" /></td> -->
              <td><el-input type="number" v-model="form.detail2List[3].wendd" @change="countMaxems(3)" @keydown.native="handleKeyDown($event, 11, 9)" :ref="'11_9'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].liuz" @change="countMaxems(3)" @keydown.native="handleKeyDown($event, 11, 10)" :ref="'11_10'" /></td>
              <td><el-input type="number" v-model="form.detail2List[3].maxems" disabled /></td>
            </tr>
            <tr height="20">
              <td><el-input type="text" v-model="form.detail2List[4].xvh" @keydown.native="handleKeyDown($event, 12, 0)" :ref="'12_0'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].zhij" @keydown.native="handleKeyDown($event, 12, 1)" :ref="'12_1'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].gaod1" @change="countGdPjz(4)" @keydown.native="handleKeyDown($event, 12, 2)" :ref="'12_2'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].gaod2" @change="countGdPjz(4)" @keydown.native="handleKeyDown($event, 12, 3)" :ref="'12_3'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].gaod3" @change="countGdPjz(4)" @keydown.native="handleKeyDown($event, 12, 4)" :ref="'12_4'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].gaod4" @change="countGdPjz(4)" @keydown.native="handleKeyDown($event, 12, 5)" :ref="'12_5'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].gaodpjz" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[4].ganzsjkzzl" @change="countXsl(4)" @keydown.native="handleKeyDown($event, 12, 6)" :ref="'12_6'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].shijszzl" @change="countXsl(4)" @keydown.native="handleKeyDown($event, 12, 7)" :ref="'12_7'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].shijbgzl" @change="countXsl(4)" @keydown.native="handleKeyDown($event, 12, 8)" :ref="'12_8'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].xisl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[4].maotjxdmd" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[4].kongxl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[4].youxlqtjbfl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[4].jianxl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[4].lqbhd" disabled /></td>
              <!-- <td><el-input type="number" v-model="form.detail2List[4].cujlgjjxl" /></td> -->
              <td><el-input type="number" v-model="form.detail2List[4].wendd" @change="countMaxems(4)" @keydown.native="handleKeyDown($event, 12, 9)" :ref="'12_9'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].liuz" @change="countMaxems(4)" @keydown.native="handleKeyDown($event, 12, 10)" :ref="'12_10'" /></td>
              <td><el-input type="number" v-model="form.detail2List[4].maxems" disabled /></td>
            </tr>
            <tr height="20">
              <td><el-input type="text" v-model="form.detail2List[5].xvh" @keydown.native="handleKeyDown($event, 13, 0)" :ref="'13_0'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].zhij" @keydown.native="handleKeyDown($event, 13, 1)" :ref="'13_1'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].gaod1" @change="countGdPjz(5)" @keydown.native="handleKeyDown($event, 13, 2)" :ref="'13_2'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].gaod2" @change="countGdPjz(5)" @keydown.native="handleKeyDown($event, 13, 3)" :ref="'13_3'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].gaod3" @change="countGdPjz(5)" @keydown.native="handleKeyDown($event, 13, 4)" :ref="'13_4'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].gaod4" @change="countGdPjz(5)" @keydown.native="handleKeyDown($event, 13, 5)" :ref="'13_5'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].gaodpjz" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[5].ganzsjkzzl" @change="countXsl(5)" @keydown.native="handleKeyDown($event, 13, 6)" :ref="'13_6'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].shijszzl" @change="countXsl(5)" @keydown.native="handleKeyDown($event, 13, 7)" :ref="'13_7'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].shijbgzl" @change="countXsl(5)" @keydown.native="handleKeyDown($event, 13, 8)" :ref="'13_8'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].xisl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[5].maotjxdmd" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[5].kongxl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[5].youxlqtjbfl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[5].jianxl" disabled /></td>
              <td><el-input type="number" v-model="form.detail2List[5].lqbhd" disabled /></td>
              <!-- <td><el-input type="number" v-model="form.detail2List[5].cujlgjjxl" /></td> -->
              <td><el-input type="number" v-model="form.detail2List[5].wendd" @change="countMaxems(5)" @keydown.native="handleKeyDown($event, 13, 9)" :ref="'13_9'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].liuz" @change="countMaxems(5)" @keydown.native="handleKeyDown($event, 13, 10)" :ref="'13_10'" /></td>
              <td><el-input type="number" v-model="form.detail2List[5].maxems" disabled /></td>
            </tr>
            <tr height="20">
              <td colspan="11">平均值</td>
              <td><el-input type="number" v-model="form.maotjxdmdpjz" disabled /></td>
              <td><el-input type="number" v-model="form.kongxlpjz" disabled /></td>
              <td><el-input type="number" v-model="form.youxlqtjbflpjz" disabled /></td>
              <td><el-input type="number" v-model="form.jianxlpjz" disabled /></td>
              <td><el-input type="number" v-model="form.lqbhdpjz" disabled /></td>
              <!-- <td><el-input type="number" v-model="form.cujlgjjxlpjz" /></td> -->
              <td><el-input type="number" v-model="form.wenddpjz" disabled /></td>
              <td><el-input type="number" v-model="form.liuzpjz" disabled /></td>
              <td><el-input type="number" v-model="form.maxemspjz" disabled /></td>
            </tr>
          </tbody>
        </table>
        <!-- .....................................................33333333333333333................................................... -->
        <table height="30px" class="bottom-table">
          <tr>
            <td>
              <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.fujsm" @focus="handleFocus('fujsm')" />
            </td>
          </tr>
        </table>
      </div>
      <!-- .................................44444444444............................................. -->
      <table height="22px" class="transparent">
        <tbody>
          <tr>
            <td width="10%" align="right">检测：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">记录：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">复核：</td>
            <td align="left" width="15%"></td>
            <td width="10%">日期：</td>
            <td align="left" width="15%">
              <div style="display: inline-block; margin-left: 20px">年</div>
              <div style="display: inline-block; margin-left: 20px">月</div>
              <div style="display: inline-block ;margin-left: 20px">日</div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
    <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
    <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
  </div>
</template>

<script>
import { listLqhhlMxebgfjlbBsInfo, getLqhhlMxebgfjlbBsInfo, delLqhhlMxebgfjlbBsInfo, addLqhhlMxebgfjlbBsInfo, updateLqhhlMxebgfjlbBsInfo } from "@/api/report_lqhhl/lqhhlMxebgfjlbBsInfo";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView.vue";
import BaQjDetailView from "@/views/sycs/baQjDetail/BaQjDetailView.vue";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView.vue";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView.vue";

import decimal from "@/utils/big-decimal";
import { handleFocus, emptyConvert, calculateMeanvalue, handleKeyDown } from "@/views/reportForms/utils";
import Bus from "@/utils/bus";
export default {
  name: "lqhhlmxebgfjlb",
  components: {
    BsInstrumentView,
    BaQjDetailView,
    BsJiancyjView,
    BsJudgeBaseView
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => ""
    },
    syType: {
      type: [String, Number],
      default: () => ""
    },
    page: {
      type: Number,
      default: () => 0
    },
    isPdf: {
      type: Boolean,
      default: () => false
    },
    printEmpty: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      params: {},
      query: {},
      // 表单参数
      form: {
        detail1List: [{}, {}, {}, {}, {}, {}, {}, {}],
        detail2List: [{}, {}, {}, {}, {}, {}]
      }
    };
  },
  watch: {
    isPdf(newVal, oldVal) {
      this.form = { ...emptyConvert(this.form, newVal) };
    }
  },
  created() {
    this.getInfo();
  },
  methods: {
    // 获取详情
    getInfo() {
      getLqhhlMxebgfjlbBsInfo(this.excelId || this.$defaultExcelId).then((response) => {
        this.form = response.data;
        if (!this.form.fujsm) {
          this.form.fujsm = "附加声明：";
        }
      });
    },
    // 显示检测依据列表
    showBsJiancyjView() {
      this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
    },
    // 检测依据选择
    selectJiancyj(info) {
      this.form.jiancyj = info.label;
      this.form.jiancyjIds = info.ids;
      Bus.$emit("setLqhhlmxebgfBgJiancyj", { jiancyj: this.form.jiancyj, jiancyjIds: this.form.jiancyjIds });
    },
    // 显示判定依据列表
    showBsJudgeBaseView() {
      this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
    },
    // 判断依据选择
    selectJudge(info) {
       this.form.pandyjIds = info.ids;
      this.form.pandyj = info.label;
    },
    // 显示仪器列表
    showBsInstrumentView() {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument(info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
      Bus.$emit("setLqhhlmxebgfBgZhuyyqsbmcjbh", { zhuyyqsbmcjbh: this.form.zhuyyqsbmcjbh, shebIds: this.form.shebIds });
    },

    handleFocus(event) {
      handleFocus(event, this.page, this.form[event]);
    },
    submitForm() {
      return this.form;
    },
    // 粉胶比FB
    countFjb() {
      let q = this.form.tonggl;
      let h = this.form.liqdxdmd;

      if (q && h) {
        this.form.fenjb = decimal.round(q / h, 1);
        Bus.$emit("setLqhhlMxesyjcbgList", [
          {
            key: 150,
            value: this.form.fenjb
          }
        ]);
      }
    },
    // 试件尺寸高度---平均值
    countGdPjz(num) {
      let g1 = this.form.detail2List[num].gaod1;
      let g2 = this.form.detail2List[num].gaod2;
      let g3 = this.form.detail2List[num].gaod3;
      let g4 = this.form.detail2List[num].gaod4;
      if (g1 && g2 && g3 && g4) {
        this.form.detail2List[num].gaodpjz = calculateMeanvalue([g1, g2, g3, g4], 1);
      }
    },
    // 吸水率 ...计算
    countXsl(num) {
      let a = this.form.detail2List[num].ganzsjkzzl;
      let b = this.form.detail2List[num].shijszzl;
      let c = this.form.detail2List[num].shijbgzl;
      if (a && b && c) {
        let xsl = ((c - a) / (c - b)) * 100; //吸水率
        let D = a / (c - b); //毛体积相对密度
        this.form.detail2List[num].xisl = decimal.round(xsl, 1);
        this.form.detail2List[num].maotjxdmd = decimal.round(D, 3);
        let e = this.form.lilzdxdmd; //理论最大相对密度
        if (e && this.form.detail2List[num].maotjxdmd) {
          let F = (1 - this.form.detail2List[num].maotjxdmd / e) * 100;
          this.form.detail2List[num].kongxl = decimal.round(F, 1);
        }
        let g = this.form.youxlqyl;
        let h = this.form.liqdxdmd;
        if (g && h && this.form.detail2List[num].maotjxdmd) {
          let I = (this.form.detail2List[num].maotjxdmd * 0.9971 * g) / h;
          this.form.detail2List[num].youxlqtjbfl = decimal.round(I, 1);
        }
        let j = this.form.kuanglhcmtjxdmd;
        let k = this.form.liqyl;
        if (j && k && this.form.detail2List[num].maotjxdmd) {
          let L = [1 - (this.form.detail2List[num].maotjxdmd / j) * (1 - k / 100)] * 100;
          this.form.detail2List[num].jianxl = decimal.round(L, 1);
        }
        if (this.form.detail2List[num].jianxl && this.form.detail2List[num].kongxl) {
          let M = ((this.form.detail2List[num].jianxl - this.form.detail2List[num].kongxl) / this.form.detail2List[num].jianxl) * 100;
          this.form.detail2List[num].lqbhd = decimal.round(M, 1);
        }
        this.countPjz("maotjxdmd", 3);
        this.countPjz("kongxl", 1);
        this.countPjz("youxlqtjbfl", 1);
        this.countPjz("jianxl", 1);
        this.countPjz("lqbhd", 1);
      }
    },
    // 空隙率VV(%)
    countKxl() {
      let e = this.form.lilzdxdmd; //理论最大相对密度
      for (let i = 0; i < 6; i++) {
        let D = this.form.detail2List[i].maotjxdmd;
        if (D && e) {
          let F = (1 - D / e) * 100;
          this.form.detail2List[i].kongxl = decimal.round(F, 1);
          this.countPjz("kongxl", 1);
          let L = this.form.detail2List[i].jianxl;
          if (this.form.detail2List[i].kongxl && L) {
            let M = ((L - this.form.detail2List[i].kongxl) / L) * 100;
            this.form.detail2List[i].lqbhd = decimal.round(M, 1);
            this.countPjz("lqbhd", 1);
          }
        }
      }
    },
    // 有效沥青体积百分率Vbe(%)
    countYxlqtjbfb() {
      let g = this.form.youxlqyl;
      let h = this.form.liqdxdmd;
      if (h) {
        this.countFjb();
      }
      for (let i = 0; i < 6; i++) {
        let D = this.form.detail2List[i].maotjxdmd;
        if (D && g && h) {
          let I = (D * 0.9971 * g) / h;
          this.form.detail2List[i].youxlqtjbfl = decimal.round(I, 1);
          this.countPjz("youxlqtjbfl", 1);
        }
      }
    },
    // 间隙率VMA(%)
    countJxl() {
      let j = this.form.kuanglhcmtjxdmd;
      let k = this.form.liqyl;
      for (let i = 0; i < 6; i++) {
        let D = this.form.detail2List[i].maotjxdmd;
        if (D && j && k) {
          let L = [1 - (this.form.detail2List[i].maotjxdmd / j) * (1 - k / 100)] * 100;
          this.form.detail2List[i].jianxl = decimal.round(L, 1);
          this.countPjz("jianxl", 1);
        }
      }
    },
    // 马歇尔模数(kN/mm)
    countMaxems(num) {
      let n = this.form.detail2List[num].wendd;
      let o = this.form.detail2List[num].liuz;
      if (n && o) {
        this.form.detail2List[num].maxems = decimal.round(n / o, 2);
      }
      this.countPjz("liuz", 1);
      this.countPjz("maxems", 2);
      this.countPjz("wendd", 2);
    },
    // 平均值
    countPjz(name, num) {
      let nameObj = {
        maotjxdmd: 143,
        kongxl: 144,
        youxlqtjbfl: 147,
        jianxl: 145,
        lqbhd: 146,
        wendd: 148,
        liuz: 149
      };

      if (name) {
        let arr = [];
        for (let i = 0; i < this.form.detail2List.length; i++) {
          if (this.form.detail2List[i][name]) {
            arr.push(this.form.detail2List[i][name]);
          }
        }
        let setName = name + "pjz";
        this.form[setName] = calculateMeanvalue(arr, num);
        if (nameObj[name]) {
          Bus.$emit("setLqhhlMxesyjcbgList", [
            {
              key: nameObj[name],
              value: this.form[setName]
            }
          ]);
        }
      }
    },

    countKuanglhcmtjxdmd() {
      let maotjxdmdArr = this.form.detail1List.map((v) => {
        if (v.maotjxdmd) return v.maotjxdmd;
      });
      maotjxdmdArr = maotjxdmdArr.filter((v) => v != null);
      let kuanglblArr = this.form.detail1List.map((v) => {
        if (v.kuanglbl) return v.kuanglbl;
      });
      kuanglblArr = kuanglblArr.filter((v) => v != null);
      let allNum = [];
      for (let i = 0; i < this.form.detail1List.length; i++) {
        if (maotjxdmdArr[i] && kuanglblArr[i]) {
          allNum.push(kuanglblArr[i] / maotjxdmdArr[i]);
        }
      }
      const sum = allNum.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
      this.form.kuanglhcmtjxdmd = decimal.round(100 / sum, 3);
      this.countJxl();
    },
    handleInput() {
      Bus.$emit("setLqhhlMxesyjcbg", {
        hunhllx: this.form.hunhllx, //混合料类型
        biaozsjcc: this.form.biaozsjcc, //标准试件尺寸(mm)
        jiscs: this.form.jiscs //击实次数
        // jiscs: this.form.jiscs,//标准试件尺寸(mm)
      });
    },
    handleKeyDown(event, rowIndex, colIndex) {
      const maxArr = [4, 2, 2, 2, 7, 7, 7, 7, 10, 10, 10, 10, 10, 10];
      const ref = handleKeyDown(event, rowIndex, colIndex, maxArr);
      if (this.$refs[ref]) {
        this.$refs[ref].focus();
      }
    }
  }
};
</script>

<style scoped>
</style>
